package abacab.exec;

import abacab.actor.Actor;

/**
 * Handles the execution of messages
 */
public interface MessageExecutor {
	/**
	 * Stop the executor
	 */
	void stop();

	/**
	 * Queue a message for execution
	 * 
	 * @param actor
	 *          the actor that will handle the message
	 * @throws IllegalStateException
	 *           if the executor is stopped
	 */
	<M> void queueForExecution(Actor<? super M> actor) throws IllegalStateException;
}